package com.duoduo;

import com.duoduo.entity.UserAddress;
import com.duoduo.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;
import java.util.List;

/**
 * Hello world!
 *
 */
public class App
{
    public static void main( String[] args ) throws IOException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/dubbo-consumer.xml");
        context.start();
        UserService userService = context.getBean(UserService.class);
        List<UserAddress> userAddresses = userService.queryAllAddress();
        for(UserAddress userAddress : userAddresses){
            System.out.println(userAddress.getId()+","+userAddress.getUserAddress()+","+userAddress.getUserId());
        }
        System.in.read();
    }
}
